Qualcomm AI Engine Direct - Optimize performance of pcq embedding#20686
Qualcomm AI Engine Direct - Optimize performance of pcq embedding#20686shewu-quic wants to merge 3 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20686
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit a551ca3 with merge base f41d66d ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
231b11e to
11bd40c
Compare
|
Hi @psiddh, |
|
@claude Can you review this PR ? |
|
Claude finished @psiddh's task in 3m 23s —— View job PR Review: Optimize performance of PCQ embedding
Nice cleanup — the new pattern is clearly better than the old one. Here's my review. Summary of the changeThe core change in
This is a solid structural improvement, and dropping the Correctness notes (looks right)
Questions / things worth confirming1. Memory/perf of converting the full weight table ( 2. 3. Version gate Minor
Overall this looks like a clean, well-motivated change. My main ask is confirming point #1 (that the static convert is folded so this is actually faster, not just more accurate) and clarifying the setattr asymmetry in #2. |
|
One qq: The test is skipped below QNN 2.48. does that mean the new pcq-embedding pattern only works on 2.48+, |
| attr = getattr(attr, target_atom) | ||
| return attr | ||
|
|
||
| setattr( |
There was a problem hiding this comment.
Should setattr match the getattr walk pattern here?
|
Also just for my understanding : The convert now runs over the whole weight table instead of just the gathered rows. Since the weight is static, is this convert constant-folded during QNN compile (so it's computed once and the runtime |
Yes, this new optimize pattern is only supported after QNN 2.48. Otherwise, it will failed to compile |
Yes, it will be fused by QNN HTP during AOT. |
Summary: - Change pcq embedding pattern for backend optimization
f749d49 to
f105816
Compare
Thanks for confirming. Since it fails to compile below 2.48 and the builder emits this pattern unconditionally, won't pcq embedding now break for anyone on our pinned 2.37? Should we either gate the builder on is_qnn_sdk_version_less_than("2.48") (fall back to the old pattern below 2.48), or bump the minimum QNN version to 2.48 and move CI accordingly? Otherwise the test skip hides a compile failure for 2.37 users |
Thanks for flagging that. I agree — I keep the legacy pattern for pcq embedding to maintain backward compatibility. |
Summary:
Test plan